GET GROUND HEIGHT

This command will calculate and return the Y coordinate within the matrix given the X and Z coordinates.

  Syntax
Return Float=GET GROUND HEIGHT(Matrix Number, X, Z)
  Parameters
Matrix Number
Integer
The matrix number
X
Float
The x position
Z
Float
The y position

  Returns

This command will calculate and return the Y coordinate

  Description

This command can be used to allows 3D objects to traverse the contours of any matrix landscape with ease. The matrix number should be an integer value. The coordinates should be real numbers.

  Example Code
ink rgb(255,255,255),0
box 1,1,101,101
get image 1,0,0,101,101
position camera 0,300,0
autocam off
make matrix 1,1000,1000,25,25
prepare matrix texture 1,1,1,1
fill matrix 1,rnd(50),1
position matrix 1,0,0,0
set matrix height 1,10,10,200
set matrix normal 1, 5, 5, 30.0, 20.0, 10.0
update matrix 1
while inkey$()<>"x"
set cursor 0,0
print "ground height at 10,10:";get ground height(1,10,10)
x#=x#+mousemovey()
y#=y#+mousemovex()
rotate camera x#,y#,0
update matrix 1
endwhile
if matrix exist(1)=1 then delete matrix 1
end
  See also

MATRIX Commands Menu
Index